package chess;
import java.util.ArrayList;

import pieces.Pawn;
import junit.framework.TestCase;
public class BoardTest extends TestCase{
	private Board board;
	
	public void setUp(){
		board =new Board();
	}
	
	public void testCreate(){
		board.initialize();
		ArrayList<Pawn> temporarylist = new ArrayList <Pawn>();
		temporarylist = board.getrowpawns(0);
		assertEquals(16, board.getnumberOfpawns(temporarylist));
		
		temporarylist = board.getrowpawns(2);
		for(Pawn pawn:temporarylist){
			assertEquals("p", pawn.getPrint());
			}
		
		temporarylist = board.getrowpawns(7);
		for(Pawn pawn:temporarylist){
			assertEquals("P", pawn.getPrint());
			}
		
		temporarylist = board.getrowpawns(2);
		assertEquals(8, board.getnumberOfpawns(temporarylist));
		
		temporarylist = board.getrowpawns(7);
		assertEquals(8, board.getnumberOfpawns(temporarylist));
	}
	
	public void testReport(){
		board.initialize();
		String boardReport = board.getReport();
		System.out.println(boardReport);
		assertEquals(
				Board.EMPTYLINE +
				"PPPPPPPP" + Board.NEWLINE +
				Board.EMPTYLINE + Board.EMPTYLINE +
				Board.EMPTYLINE + Board.EMPTYLINE +
				"pppppppp" + Board.NEWLINE +
				Board.EMPTYLINE
				, boardReport);
	}
}
